package behavior.Mediator;

/**
 * Created by LYJ on 2016/10/21.
 * 详细链接：Mediator（中介者）http://blog.csdn.net/u013256816/article/details/51058254
 */
public class MainTest {
    public static void main(String... args) {
        MediatorStructure mediator = new MediatorStructure();

        HouseOwner houseOwner = new HouseOwner("tom",mediator);
        Tenant tenant = new Tenant("mary",mediator);

        mediator.setHouseOwner(houseOwner);
        mediator.setTenant(tenant);

        tenant.contact("我想租一个房子");
        houseOwner.contact("我有一个房子要出租");
    }
}
